package com.heima.test1.domin;

import java.util.ArrayList;
import java.util.Scanner;

public  class StudentTool {
    static ArrayList<Student> list = new ArrayList<>();

    public static void getStudent() {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入学生id");
        String id = sc.next();
        System.out.println("请输入学生姓名");
        String name = sc.next();
        System.out.println("请输入学生年龄");
        int age = sc.nextInt();
        Student stu = new Student(id, name, age);
        list.add(stu);
    }

    public static void setStudent() {
        for (int i = 0; i < list.size(); i++) {
            Student stu = list.get(i);
            System.out.println("学生id为：" + stu.getId() + "\t学生姓名为：" + stu.getName()
                    + "\t学生年龄为：" + stu.getAge());
        }
    }
}
